cmake_minimum_required(VERSION 3.16)

# # 设置 C 编译器
# set(CMAKE_C_COMPILER /home/hhquan/Projects/AI编译工具和框架/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc)  # 或者 /path/to/clang
# # 设置 C++ 编译器
# set(CMAKE_CXX_COMPILER /home/hhquan/Projects/AI编译工具和框架/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++)  # 或者 /path/to/clang++

project(athena-signal-cmake-demo)

set(CMAKE_BUILD_TYPE "Release")


include_directories(
    ${PROJECT_SOURCE_DIR}/athena_signal
)

set(SOURCES
    ${PROJECT_SOURCE_DIR}/athena_signal/dios_signal.c
    ${PROJECT_SOURCE_DIR}/athena_signal/ring_buffer.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_api.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_tde/dios_ssp_aec_tde.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_tde/dios_ssp_aec_tde_delay_estimator.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_tde/dios_ssp_aec_tde_delay_estimator_wrapper.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_tde/dios_ssp_aec_tde_ring_buffer.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_common.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_doubletalk.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_erl_est.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_firfilter.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_aec/dios_ssp_aec_res.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_agc/dios_ssp_agc_api.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_doa/dios_ssp_doa_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_doa/dios_ssp_doa_win.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_abm.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_adaptctrl.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_aic.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_beamformer.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_beamsteering.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_dsptools.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_filtsumbeamformer.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_firfilterdesign.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_micarray.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_multigscbeamformer.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_gsc/dios_ssp_gsc_rmNPsdOsMs.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_hpf/dios_ssp_hpf_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_hpf/dios_ssp_mchpf_api.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_mvdr/dios_ssp_mvdr_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_mvdr/dios_ssp_mvdr_cinv.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_mvdr/dios_ssp_mvdr_header.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_mvdr/dios_ssp_mvdr_win.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_mvdr/dios_ssp_mbeam_mvdr.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_ns/dios_ssp_ns_api.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_share/dios_ssp_share_cinv.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_share/dios_ssp_share_complex_defs.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_share/dios_ssp_share_noiselevel.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_share/dios_ssp_share_rfft.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_share/dios_ssp_share_subband.c

    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_vad/dios_ssp_vad_api.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_vad/dios_ssp_vad_counter.c
    ${PROJECT_SOURCE_DIR}/athena_signal/kernels/dios_ssp_vad/dios_ssp_vad_energy.c

)

add_executable(athena_signal_test 
    athena_signal/dios_signal_test.c 
    athena_signal/kernels/dios_impl.c
    ${SOURCES}
)
target_link_libraries(athena_signal_test PUBLIC m)


# add_executable(mbeam_test mbeam_mvdr_test.c ${SOURCES})
# target_link_libraries(mbeam_test PUBLIC m)